#define _CRT_SECURE_NO_WARNINGS 1
#include<string>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	vector<string>vec;
	int n;
	cin >> n;
	string ans;
	for (int i = 0; i < n; i++) {
		string str;
		cin >> str;
		if (vec.size() == 0) {
			vec.push_back(str);
			ans += str;
		}
		int m = vec.size();
		for (int j = 0; j < vec.size(); j++) {
			if (str != vec[j]) {
				m--;
				continue;
			}
		}
		if (m == 0) {
			vec.push_back(str);
			ans += str;
		}
	}
	cout << ans;



	return 0;
}